package br.facet.pojo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.hibernate.annotations.Proxy;

@Entity
@Proxy(lazy=false)
@Table(name = "TBL_LOJA")
@SequenceGenerator(name = "seq_loja", sequenceName = "seq_loja", allocationSize = 1)
public class Loja {

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seq_loja")
	@Column
	private Integer id;

	@Column
	private String nome;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public boolean equals(Object other){  
	    return other instanceof Loja && equals((Loja)other);  
	}  
	  
	public boolean equals (Loja other){  
	    return this.id.equals(other.id) & this.nome.equals(other.nome);	    
	}  
	 
	public int hashCode(){  
	    return id.hashCode() & nome.hashCode();  
	}
}
